import java.util.Scanner;

public class Test3 {
    //利用方法重载，编写四个重载方法，分别求两个整数和、三个整数和、两个小数和、两个字符串类型拼接。
    public int num(int a, int b) {
        return a + b;
    }

    public int num(int a, int b, int c) {
        return a + b + c;
    }

    public double num(double a, double b) {
        return a + b;
    }

    public String num(String a, String b) {
        return a + b;
    }

    public static void main(String[] args) {
        Test3 t=new Test3();
        System.out.println("两个整数和:"+t.num(3,4));
        System.out.println("三个整数和:"+t.num(3,2,5));
        System.out.println("两个小数和:"+t.num(3.4,4.2));
        System.out.println("两个字符串:"+t.num("哈","喽"));
    }
}
